package com.chujian.wx.entity;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chujian.framework.core.IId;
import com.chujian.framework.core.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author chujian
 * @since 2021-10-14
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("wx_mp_templ_msg")
@KeySequence("wx_mp_templ_msg_seq")
@ApiModel(value = "实体", description = "")
public class WxMpTemplMsg extends BaseEntity implements IId, Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "消息id")
    @TableId("msg_id")
    private Long msgId;

    @ApiModelProperty(value = "消息体 ")
    @TableField("msg")
    private String msg;

    @ApiModelProperty(value = "公众号id")
    @TableField("open_id")
    private String openId;

    @ApiModelProperty(value = "腾讯的msgId")
    @TableField("tx_msg_id")
    private String txMsgId;

    @ApiModelProperty(value = "发送结果")
    @TableField("rs")
    private String rs;


    // ++++++ 系统拓展 +++++++
    @TableField(exist = false)
    private Map<String, String> query = new HashMap<>();

    @Override
    public Long getId() {
        return this.msgId;
    }

    @Override
    public void setId(Serializable id) {
        if (null != id) {
            this.msgId = Long.parseLong("" + id);
        }
    }

    // ++++++ 业务拓展 +++++++
}
